using System;
using System.Data.SqlClient;

/// <summary>
/// A class that represents a Cmdlet ParameterSet Entry
/// </summary>
public class PsSpecCmdletParameterSetEntry : IPsSpecDataReader
{
    public PsSpecCmdletParameterSetEntry() { }

    public void Initialize(SqlDataReader reader, System.Collections.Generic.Dictionary<string, Int32> columnMappings)
    {
        this.parameterSetEntryId = reader.GetInt32(columnMappings["ParameterSetEntryId"]);
        this.projectName = reader[columnMappings["ProjectName"]] as string;
        this.cmdletName = reader[columnMappings["CmdletName"]] as string;
        this.parameterName = reader[columnMappings["ParameterName"]] as string;

        this.parameterId = reader.GetInt32(columnMappings["ParameterId"]);
        this.parameterSetName = reader[columnMappings["ParameterSetName"]] as string;
        if (!(reader[columnMappings["Mandatory"]] is DBNull)) { this.mandatory = (bool)reader[columnMappings["Mandatory"]]; }
        if (!(reader[columnMappings["Position"]] is DBNull)) { this.position = reader.GetInt32(columnMappings["Position"]); }
        if (!(reader[columnMappings["ValueFromPipeline"]] is DBNull)) { this.valueFromPipeline = (bool)reader[columnMappings["ValueFromPipeline"]]; }
        if (!(reader[columnMappings["ValueFromPipelineByPropertyName"]] is DBNull)) { this.valueFromPipelineByPropertyName = (bool)reader[columnMappings["ValueFromPipelineByPropertyName"]]; }
        if (!(reader[columnMappings["ValueFromRemainingArguments"]] is DBNull)) { this.valueFromRemainingArguments = (bool)reader[columnMappings["ValueFromRemainingArguments"]]; }
        this.helpMessage = reader[columnMappings["HelpMessage"]] as string;
        this.helpMessageBaseName = reader[columnMappings["HelpMessageBaseName"]] as string;
        this.helpMessageResourceId = reader[columnMappings["HelpMessageResourceId"]] as string;
    }

    public int Id
    {
        get { return parameterSetEntryId; }
        set { parameterSetEntryId = value; }
    }
    private int parameterSetEntryId = 0;

    public string ProjectName
    {
        get { return projectName; }
        set { projectName = value; }
    }
    private string projectName = null;

    public string CmdletName
    {
        get { return cmdletName; }
        set { cmdletName = value; }
    }
    private string cmdletName = null;

    public string ParameterName
    {
        get { return parameterName; }
        set { parameterName = value; }
    }
    private string parameterName = null;

    public int ParameterId
    {
        get { return parameterId; }
        set { parameterId = value; }
    }
    private int parameterId = -1;

    public string ParameterSetName
    {
        get { return parameterSetName; }
        set { parameterSetName = value; }
    }
    private string parameterSetName = null;

    public bool Mandatory
    {
        get { return mandatory; }
        set { mandatory = value; }
    }
    private bool mandatory = false;

    public int? Position
    {
        get { return position; }
        set { position = value; }
    }
    private int? position = null;

    public bool ValueFromPipeline
    {
        get { return valueFromPipeline; }
        set { valueFromPipeline = value; }
    }
    private bool valueFromPipeline = false;

    public bool ValueFromPipelineByPropertyName
    {
        get { return valueFromPipelineByPropertyName; }
        set { valueFromPipelineByPropertyName = value; }
    }
    private bool valueFromPipelineByPropertyName = false;

    public bool ValueFromRemainingArguments
    {
        get { return valueFromRemainingArguments; }
        set { valueFromRemainingArguments = value; }
    }
    private bool valueFromRemainingArguments = false;

    public string HelpMessage
    {
        get { return helpMessage; }
        set { helpMessage = value; }
    }
    private string helpMessage;

    public string HelpMessageBaseName
    {
        get { return helpMessageBaseName; }
        set { helpMessageBaseName = value; }
    }
    private string helpMessageBaseName;

    public string HelpMessageResourceId
    {
        get { return helpMessageResourceId; }
        set { helpMessageResourceId = value; }
    }
    private string helpMessageResourceId;
}
